﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FoxCommerce.MVC.Data.Infrastructure;
using FoxCommerce.MVC.Domain.Entities;

namespace FoxCommerce.MVC.Data.Repositories
{
    public class RoleRepository : EntityRepository<Role>, IRoleRepository
    {
        public RoleRepository(IDatabaseFactory databaseFactory)
            : base(databaseFactory)
        {
        }


        public Role FindRole(string roleName)
        {
            return DataContext.Roles.Where(z => z.RoleName == roleName).SingleOrDefault();
        }
    }
    public interface IRoleRepository : IRepositoryBase<Role>
    {
        Role FindRole(string roleName);
    }
}
